package com.gopay.bis.dao.payconfig.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.bis.dao.payconfig.BisBankProductLimitMerchantsDao;
import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.bis.BisProductLimitMerchants;

/** 
 * 商户--银行产品额度类型配置表DAO实现
 * @ClassName: BisBankProductLimitMerchantsDaoImpl 
 * @author w_jiqing 
 * @date 2017年4月26日 下午2:33:21  
 */ 
@Repository("bisBankProductLimitMerchantsDao")
public class BisBankProductLimitMerchantsDaoImpl extends BaseDAOImpl<BisProductLimitMerchants, String>
        implements BisBankProductLimitMerchantsDao {

    @Override
    public List<BisProductLimitMerchants> getEnableMerchantsByMerId(String merId) {
        String hql = "from BisProductLimitMerchants where enable='1' and merId = :merId";
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("merId", merId);
        List<BisProductLimitMerchants> list = findByHql(hql, map);
        return list;
    }

    @Override
    public List<BisProductLimitMerchants> getEnableMerchantsByMerIdBankProductLimit(String merId, String bank, String prod,
            String limitType) {
        String hql = "from BisProductLimitMerchants where enable = '1' and merId=:merId and bankCode=:bankCode and bankBizProdCode=:bankBizProdCode and limitType=:limitType";
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("merId", merId);
        map.put("bankCode", bank);
        map.put("bankBizProdCode", prod);
        map.put("limitType", limitType);
        List<BisProductLimitMerchants> list = findByHql(hql, map);
        return list;
    }

}
